package com.ny.wlw;

public class Pet {
    private String name;
    private int age;

    public Pet(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public String makeSound() {
        return "";
    }
}

    class Dog extends Pet {
        public Dog(String name, int age) {
            super(name, age);
        }

        public String makeSound() {

            return "汪!";
        }
    }

    class Cat extends Pet {
        public Cat(String name, int age) {
            super(name, age);
        }

        public String makeSound() {
            return "喵!";
        }
}
